#include <iostream>
using namespace std;

class A {
	protected:
		int m_a;
};

class B : virtual public A {
	protected:
		int m_b;
};

class C : virtual public A {
	protected:
		int m_c;
};

class D : public B, public C {
	public:
		void test() { m_a = 1; m_b = 2; m_c = 3; m_d = 4; }

		void show() {
			cout << m_a << ", " << m_b << ", " << m_c << ", " << m_d << endl;
		}
	protected:
		int m_d;
};

int main(void)
{
	D d;

	d.test();
	d.show();

	return 0;
}

